import 'package:flutter/material.dart';

import 'color.dart';

class AppTheme {
  static const horizontalMargin = 16.0;
  static const radius = 10.0;

  static ThemeData light = ThemeData(
    brightness: Brightness.light,
    scaffoldBackgroundColor: AppColor.scaffoldBackground,
    splashColor: Colors.transparent,
    highlightColor: Colors.transparent,
    primaryColor: AppColor.accentColor,
    colorScheme: ColorScheme.fromSwatch().copyWith(
      secondary: AppColor.accentColor,
    ),
    appBarTheme: const AppBarTheme(
      elevation: 0,
      centerTitle: true,
      backgroundColor: Colors.white,
      iconTheme: IconThemeData(
        color: AppColor.primaryText,
      ),
      titleTextStyle: TextStyle(
        color: AppColor.primaryText,
        fontSize: 22,
        fontWeight: FontWeight.w400,
      ),
      toolbarTextStyle: TextStyle(
        color: AppColor.primaryText,
        fontSize: 20,
        fontWeight: FontWeight.w500,
      ),
    ),
    bottomNavigationBarTheme: const BottomNavigationBarThemeData(
      backgroundColor: AppColor.scaffoldBackground,
      unselectedLabelStyle: TextStyle(fontSize: 12),
      selectedLabelStyle: TextStyle(fontSize: 12),
      unselectedItemColor: Color(0xffA2A5B9),
      selectedItemColor: AppColor.accentColor,
    ),
    tabBarTheme: const TabBarTheme(
      indicatorSize: TabBarIndicatorSize.label,
      labelColor: AppColor.accentColor,
      unselectedLabelColor: AppColor.secondaryText,
    ),
  );

  static ThemeData dark = ThemeData(
    brightness: Brightness.dark, // //深色还是浅色,也就是暗黑模式还是正常模式
    primaryColor: const Color(0xff606060), //主题色,单独设置导航栏和tabbar颜色
    primaryColorLight: const Color(0xff323232), // 浅主题色
    primaryColorDark: const Color(0xff606060), // 深主题色
    indicatorColor: Colors.white, // Tab指示器的颜色
    scaffoldBackgroundColor: AppColor.scaffoldBackground, // 页面骨架背景颜色
    progressIndicatorTheme: const ProgressIndicatorThemeData(
        color: AppColor.primaryText), //progressIndicator 的背景颜色
    // primarySwatch: AppColor.createMaterialColor(
    //     Color(0x23232380)), //Material 组件默认使用这个颜色 如果没配置则是一个蓝色
    // 大部分的ListTile 控件都会用到 除了ExpansionTile 他会覆盖一部分组件样式
    listTileTheme: const ListTileThemeData(
        selectedTileColor: Colors.blue, iconColor: Color(0xffDEDEDE)),
    // cardColor: ,
    iconTheme:
        const IconThemeData(size: 28, color: Color(0xffECECEC)), //icon的主题设置
    splashColor: Colors.transparent, // 水波纹颜色
    highlightColor: Colors.transparent, // 高亮颜色
    // colorScheme: ColorScheme.fromSwatch().copyWith(
    //   secondary: AppColor.accentColor,
    // ),

    appBarTheme: const AppBarTheme(
      elevation: 0,
      centerTitle: true,
      backgroundColor: Colors.transparent,
      iconTheme: IconThemeData(
        color: Color(0xffEBEBEB),
        size: 28,
      ),
      titleTextStyle: TextStyle(
        color: Colors.white,
        fontSize: 22,
        fontWeight: FontWeight.w400,
      ),
      toolbarTextStyle: TextStyle(
        color: AppColor.primaryText,
        fontSize: 20,
        fontWeight: FontWeight.w400,
      ),
    ),
    bottomNavigationBarTheme: const BottomNavigationBarThemeData(
      backgroundColor: AppColor.scaffoldBackground,
      unselectedLabelStyle: TextStyle(fontSize: 12),
      selectedLabelStyle: TextStyle(fontSize: 12),
      unselectedItemColor: Color(0xffA2A5B9),
      selectedItemColor: AppColor.accentColor,
    ),
    tabBarTheme: const TabBarTheme(
      indicatorSize: TabBarIndicatorSize.label,
      labelColor: AppColor.accentColor,
      unselectedLabelColor: AppColor.secondaryText,
    ),
    primaryTextTheme: const TextTheme(
      displayLarge: TextStyle(color: Colors.white, fontSize: 25), //最大显示样式
      displayMedium: TextStyle(), // 中等显示样式
      displaySmall: TextStyle(), //最小显示样式
      headlineLarge: TextStyle(), //最大大标题样式
      headlineMedium: TextStyle(), //中等大标题样式
      headlineSmall: TextStyle(), //最小大标题样式
      titleLarge: TextStyle(), //最大小标题样式
      titleMedium: TextStyle(), // 最小小标题样式
      bodyLarge: TextStyle(), //最大段落样式
      bodyMedium: TextStyle(), //中等段落样式
      bodySmall: TextStyle(), // 最小段落样式
    ),
    textTheme: const TextTheme(
        displayLarge: TextStyle(
            color: Colors.white,
            fontSize: 20,
            fontWeight: FontWeight.w400), //最大显示样式
        displayMedium: TextStyle(
            color: Colors.white,
            fontSize: 16,
            fontWeight: FontWeight.w400), // 中等显示样式
        displaySmall: TextStyle(
            color: Colors.white,
            fontSize: 14,
            fontWeight: FontWeight.w400), //最小显示样式
        headlineLarge: TextStyle(
            color: Colors.white,
            fontSize: 20,
            fontWeight: FontWeight.w400), //最大大标题样式
        headlineMedium: TextStyle(
            color: Colors.white,
            fontSize: 16,
            fontWeight: FontWeight.w400), //中等大标题样式
        headlineSmall: TextStyle(
            color: Colors.white,
            fontSize: 14,
            fontWeight: FontWeight.w400), //最小大标题样式
        titleLarge: TextStyle(
            color: Colors.white,
            fontSize: 20,
            fontWeight: FontWeight.w400), //最大小标题样式
        titleMedium: TextStyle(
            color: Colors.white,
            fontSize: 16,
            fontWeight: FontWeight.w400), // 中等小标题样式
        titleSmall: TextStyle(
            color: Colors.white,
            fontSize: 14,
            fontWeight: FontWeight.w400), // 最小小标题样式
        bodyLarge: TextStyle(
            color: Colors.white,
            fontSize: 20,
            fontWeight: FontWeight.w400), //最大段落样式
        bodyMedium: TextStyle(
            color: Colors.white,
            fontSize: 16,
            fontWeight: FontWeight.w400), //中等段落样式
        bodySmall: TextStyle(
            color: Colors.white,
            fontSize: 14,
            fontWeight: FontWeight.w400) // 最小段落样式
        ),
  );
}
